// map_component.js
(function(window) {
    const { processData, drawMap } = window;

    document.getElementById('fileInput').addEventListener('change', function(event) {
        const file = event.target.files[0];
       if (file) {
            processData(file);
        }
    });

    document.getElementById('serviceSelect').addEventListener('change', function() {
        const selectedService = this.value;
        if (selectedService) {
            drawMap(selectedService);
        } else {
            clearCharts();
        }
    });

    function clearCharts() {
        window.clearCharts();
    }

    function drawMap(selectedService) {
        window.drawMap(selectedService);
    }

    window.clearCharts = clearCharts;
    window.drawMap = drawMap;
})(window);